{extend name='common/common' /}
{block name="style"}

{/block}
{block name="content"}
<el-card class="box-card">
	<div slot="header">
		<span class="span-primary"><i class="fa fa-map-marker"></i></span>
		地理信息分布统计
	</div>
	<div class="seaBox">
		<el-form :inline="true" class="search-table-form">
			<el-form-item>
				<el-select v-model="sea.depart_id" placeholder="请选择地区">
					{volist name="departs" id="v"}
					<el-option label="{$v.name}" value="{$v.id}"></el-option>
					{/volist}
				</el-select>
			</el-form-item>
			<!-- <el-form-item>
				<el-select v-model="sea.type" placeholder="类型">
					<el-option label="请选择类型" value="" selected></el-option>
					<el-option label="建档立卡贫困村" value="1"></el-option>
					<el-option label="公共服务体系" value="2"></el-option>
					<el-option label="物流配送体系" value="3"></el-option>
					<el-option label="农村产品上行" value="4"></el-option>
					<el-option label="农村电商培训" value="5"></el-option>
				</el-select>
			</el-form-item> -->
			<el-form-item>
				<el-date-picker
					v-model="sea.s_time"
					type="month"
					value-format="timestamp"
					placeholder="开始月份">
				</el-date-picker>
			</el-form-item>
			<el-form-item>
				<el-date-picker
					v-model="sea.e_time"
					type="month"
					value-format="timestamp"
					placeholder="结束月份">
				</el-date-picker>
			</el-form-item>
			<el-form-item>
				<el-button type="info" plain @click="getMap">查询</el-button>
			</el-form-item>
		</el-form>
	</div>
	<div class="mapBox">
		<iframe :src="iframe_src" width="100%" height="600" frameborder="0"></iframe>
	</div>
</el-card>
{/block}

{block name="script"}
<script type="text/javascript">
var main = new Vue({
	el:"#main",
	data:{
		loading:false,
		iframe_src:"",
		sea:{
			depart_id:"{$default_depart_id|default=''}",
			s_time:"{$default_s_time|default=''}",
			e_time:"{$default_e_time|default=''}",
			type:""
		}
	},
	mounted:function() {
		this.getMap();
	},
	methods:{
		getMap() {
			var url = "{:url('Gis/distribution_gis')}";
			url += "?depart_id=" + this.sea.depart_id;
			url += '&s_time=' + (Number(this.sea.s_time)/1000);
			url += '&e_time=' + (Number(this.sea.e_time)/1000);
			url += "&type=" + this.sea.type;
			this.iframe_src = url;
		}
	}
})
</script>
{/block}
